﻿@model DatNuocViet.Models.New
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    string lang = (Session["Language"] == null) ? "vi" : Session["Language"].ToString();
    string url = HttpContext.Current.Request.Url.AbsoluteUri;
}
@helper FormatDatime(DateTime? date)
{
    DateTime result = (DateTime)date;
    
    @result.ToString("dd-MM-yyyy")
}
@section tourArea1
{
<div style="border:1px solid #F1EEEB">
    <h2 class="subtitle">
    <a href="@Url.Action("index", "news", new { id = ViewBag.newsTypeId })" >@ViewBag.NewsType</a>
    </h2>
    <div style="padding: 0 12px 12px 12px">
    <div id="social_nav_horizontal">
      <ul>
        <li style="margin:0px !important"><a class="delicious" href="http://del.icio.us/post?url=@url" title="Bookmark on del.icio.us">Delicious</a></li>
        <li><a class="facebook" href="http://www.facebook.com/sharer.php?u=@url"  title="Share this on Facebook" >Facebook</a></li>
        <li><a class="stumbleupon" href="http://www.stumbleupon.com/submit? url=@url" title="Stumble This Page" > Stumble</a></li>
        <li><a class="twitter" href="http://twitter.com/home?status=@url" title="Tweet This Page" >Twitter</a></li>
      </ul>
    </div>
    <div style="clear:both"></div>
    <div style="margin:15px 0px 15px 0px">@FormatDatime(Model.CreateOn)</div>
    <div class="Title-detailNews">@if (lang == "en")
                                  { @Html.Raw(Model.TitleEn);
                                  }
                                  else
                                  { @Html.Raw(Model.TitleVn);
                                  }</div>
                                  @if(Model.NewsType == 4)
                                  {
                                      string srcClip = Model.DetailsVn.Replace("<p>", "");
                                      srcClip = srcClip.Replace("</p>","");

                                      if (!srcClip.Contains("embed"))
                                      {
                                          if (srcClip.Contains("http://youtu.be"))
                                          {
                                              srcClip = srcClip.Replace("http://youtu.be", "http://www.youtube.com/embed");
                                          }
                                          else
                                          {
                                              srcClip = "http://www.youtube.com/embed/" + srcClip;
                                          }
                                      }
                                      
                                      <iframe width="680" height="510" src="@srcClip" frameborder="0" allowfullscreen></iframe>
                                  }
                                  else
                                  {
                                      if (lang == "en")
                                      { @Html.Raw(Model.DetailsEn);
                                      }
                                      else
                                      { @Html.Raw(Model.DetailsVn);
                                      }
                                  }
    </div>
</div>
@*tin lien quan*@
<div style="margin-top:10px;">
    @foreach(var item in (List<DatNuocViet.Models.SearchNewsResult>)ViewData["RelateNews"])
    {
         <a href="@Url.Action("Details", "News", new { id = item.NewsId })"
                        title="@if (lang == "en"){ @Html.Raw(item.TitleEn);}else{ @Html.Raw(item.TitleVn);}">@if (lang == "en"){ @Html.Raw(item.TitleEn);}else{ @Html.Raw(item.TitleVn);}</a>
        <br />
    }
</div>
@*end*@
}
